fixing JS part to be in sync with Java version