Added support for middleware mounting