Added working save config+contacts on close functionality.