Fixed middleware bug with importing wrong module.