"Fixed" forEach

Replaced forEach with jQuery's $.each