bug fix and typo fix