add thread argument check