fixed the bug with multiprocessing always starting from the beginning