added login check