improved error deduplication