Add defer to base helper variables