Fixed null nexttoarrive bug