Added close button and event handler for settings panel