Bug fix in router.js