changed process to update totalPrice