added an example that uses middleware and prePrep