adding ctrl-c protection, command line