added error handling for login