implemented form validation for login