Fix login checking