Handle login properly. Change index page