check for valid route during pattern creation