fix route appending bug reported by @othree