Added validation for registration form data.