Added login check