fixed a small bug when attributes are added on the fly