Updated js with range-with-threshold fix.