remove attribute correctly
check correct attr undefined