OP-1309 fixed bug in outerloop