Merged login error

Still needs some work, but I took the pull request