fixing the Javascript syntax