fix the handling of STOP_RUNNING