pass in middleware as as instance.