Fixed route and revise Javascript