added support for functions as datasource