Changed the log out function a bit.