update middleware issue where context and req object wasn't correct.