add login functionality and page switcher