Added thread timeout.