added error handling for login form in view