updated middleware example
WIP