for routing, keep map and count in closure