implement CTRL C safe interrupt