changed exceptions to use newer "as" logic