fixes typo in middleware