Fix bug in router