fixing misspelling and some bugs