remove assert and replace with non-test check