preprocess data in controller