proper shutdown added (ctrl-c or process kill)