fix bugs by issue-116