add loginPage and fixed some bugs