use promise to check login