More reordering to avoid race conditions