fixed a bug which cause collection to fail when a datasource adds custom objects