Fixed a bug in routing