fix multi tenancy for static middle ware