Added persistent login and other stuff