waiting for update task before application exit