Modified logout function to match elevated permission change