Fixed JS error by adjusting variable name

Name of a variable was changed in a declaration but not where it was used. Changed it there as well now.