improve error handling: notice which class has problem clearly