added check for JQuery before initialization