wait for the futures to complete