Changed/fixed custom route selection logic