Chaned the logic to calculate total cost in add request