Fix issue with undefined attr