Fixed missing endfor