New attempt to fix logout problems