Fix #2521 by @scento
Merge pull request #2534 from dreamsxin/2521

Fix #2521