update sum() for optional base