added error handling for missing required fields in login form