fix bugs in router