switch from `throw` to `assert`