Updating JS for new jQuery versions