Added setAttribute method to set the attribute to null when is an empty string