fix writeArrivals