changed from generic function to edgeFunction.