validation of the code