Fix map function from python 2 to python 3