added catch for keyboard interrupt for cleaner shutdown