add graceful Ctrl-C handling