Try to fix error

Trying to fix error: "AttributeError: 'NoneType' object has no attribute 'startswith'"
Fix sg is not defined
Merge pull request #13 from alexandrusavin/master

Trying to fix error: "AttributeError: 'NoneType' object has no attribute 'startswith'"