fix issue#617
Merge pull request #634 from kevin000/issue#215

fix issue#617