fix #1014
fixed # 1102
Merge pull request #1106 from Soul1355/master

fix #1014