Fixed undefined reference JS error