Fixed bug with logout