added graceful exit to keyboard interrupt