585 add close event to x button

closes #585