improve stop script