keyboard interrupt handling added to threads.