fix typo and add unittest