Fixing template/js error