fix case when jQuery global variable is not defined