Added support for a preprocess function