add function to set and remove attribute