replace assert with xassert