fixed crash

Conflicts:
Merge pull request #1 from PhearTheCeal/master

fixed crash