fixed a bug in the router