Fixing errors with logout