Fixed totalPrice function