make multitenancy function as expected