fix bugs. close #22