fix infinite loop during reverse routing