Added validation for registration