better error messages instead of asserts