fix typo and remove unused variable