Fixed adding lines in loop