Replaced reference to global jQuery var with $ closure var