fix order of login checks