change return of getLayersByEntities()