fix missing 'endfor'