replace subprocess usage with multiprocess