fixed crash
Merge pull request #708 from ZappoMan/bug_fixes

fixed crash