fixed error handling in login request