add logging for visit match, cleanup