updated error handling on login