fixes #1871 typo in java script