Change internal method getLayerIdByName by getMainLayer