fixed NPE on login with invalid username