Adding search direction before tabling