preprocess hook