Modified script to be not interactive also in the stop phase