handling Ctrl-C in console