fixing delayed_job bug on threads destroy