Delete elements before close app.