bug fix in loop module