updated preprocess.py in sync with the multi case