trying to make handling of Ctrl-C a bit better