Made some minor changes to the validation