Fixed linNum in loop