fix bug in matchRec
fix severe bug, left rel should be at inner loop