fix #212, #214
Merge pull request #220 from xiechao06/issue214,212

fix #212, #214