stop script improved