Updated termination procedure
Updated iCloud logic