correct typo, delete duplicated code