invoke router.param() only when necessary

fixes #2121