Fixed the visitor pattern