update routing function