fix Issue #1145
Merge pull request #1164 from yhz/patch-2

fix Issue #1145