Added death cleanup to the application process