fix usage of router to avoid page flash on navigation