improved start/stop scripts with more robust stop pattern