fix server 500 error on invalid login bug