fix exit when a future is waiting