fix delivery calculation