Replacing .map() with .each()

.map() changes prevObject thus breaking end() method on that object