fixed login error handeling