Fix bug when sobject is not enabled