visitor pattern fix compilation error