fix bugs in routes.js