fix use of map iterator