dataFactory function fix