fixed 500 internal error on failed login