Fix use of $.each