fixed login error conditions