modified router.coffee