Fix for logout errors while switching accounts