Fixed bug with logging out and back in again