changed login error handling