fix dialog not being cleared when closed with ESC