handled ctrl-c events