fix for using static memory in reduceBuffer, working example, but not full reduceBuffer