Margin correction for CTA