make candidates filter out invalid paths