throw an exception instead of false asserts