fix typo with check function