validations and errorhandling in registration