Added a destroy function that deletes the current application.