Add close buttons and 'ESC' key handlers