Same as above. ```add_attributes_to_layer``` is just a shorter way to start editing a layer, add attributes, then stop commit changes. In this case (as well as above) we also need to do other stuff before committing changes.