bug fixed for multi-tenant