added distance consideration in delivery_ready