fix typo and create thread