fixed a bug where route order was not preserved if routes had same index