Attempt to solve issue #55 where logout causes error