Prevent crash dealing with multilayers.