fixed bug in preprocessing script