Bug fix: Should catch AttributeError