fixed order flag problem in JS.java