fixed log in map function