write contacts on system shutdown