fixes crashes
Merge branch 'master' of https://github.com/castro12321/SG