close #52 , some fixes