bug fix in JavaScript client