clear the attributes before adding new elements else they get concatenated and though its possible, it is not very likely that that is intended behaviour