Added login error handling