change from multi-process to multi thread