Added check that reduction_script exists before calling delete