switch from $.each to [].forEach because real browsers