Added data validation for registration