fix bugs
merge the issue-101 branch