added type parameter for visitor exceptions