fix bug

close #14

close #9

close #6