replaced raster:::layerNames() with raster:::names()