adds finite timeout to thread killing. this was hanging.