fixes close on cancel when red X is clicked