minor fix to JavaScript