Fix for terminating threads in ramp time