Added login check to add last login