add multi-thread ability