added handling of keyboard interrupt.  now writes out and moves logs before exiting