kill the process when the error happens