change map to each for older jQ versions