better route detection