router.js: moving up dict check