Ensure that only group layers whose content is to be displayed are added.