What about using the nice method you have created ```add_attributes_to_layer```?