compatible for early versions
Merge pull request #578 from wenshao/master

compatible for early versions