fix close buttons in panels, closes #266