if divider is hidden, do not add it to container