add leave method to visitor