try to fix bugs in preprocess