add validation to register