fix order of parameters in array_reduce