bugfix

a bug lead to crash
Merge pull request #8 from WyattZhang/master

bugfix