fixed query fns to account for duplicate routes