fixes logout helper function