fixing bug in stop scripts