fix usage of reduce