add mutli thread version