fix JavaScript error ($ is not defined)