added query validation on router.