fix logic when removing routes