Fix how jQuery is passed to closure