Fix js error where $ is not defined