fix typo: endi => end