added logic for match exceptions