add direction matching patch for qos-scripts from #1708