Fixed the login, added logout functionality.