Fixed AttributeError bug on line 215