fix typo invalid for loop end