add thread-id support