add server-side validation for registration form