replace array_walk with array_map