did some error checking when logging in