Fix bug with Attribute Error