check the right class of exceptions