fix a bug on an undefined attr