Fixed a bug in preprocess