fix wrong assertion logic