further fixes in multitenancy