solved crash on exit when ios device disconnects