fix the login check