Fix to login checking