better handle ctrl-c closes