Attribute Exception error fixed