Close the open head when clicking outside the popup