fix the shutdown of the process