Make DoF only run when required.