iteration over map bug fix