improved error detection (don't assert)