Added saving of settings onclose app
Added export result to file