changing from multi-process to multi-thread