Fixed a bug in the router class