changing js to comply to routing