Fix use of jQuery.each()