fixed issue related to caching entities during sync_entities