handles the ctrl-c