added a login check