Try to fix error

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