modify to belong to isLogin method