changed the way the layer is added to leaflet dom