add ctrl-c support