updates js to consider stage