fixed typo and add some unit test