changes to JS for jquery update 1.9