Fix for issues logging out