fix a typo and a bug