update with login page and main page switch function