fix issue where map.forEach returned boolean instead of int