fix a logical error
Merge pull request #3304 from minggo/develop

fix a logical error