made a function to update total price