Fix a bug in routing