fix wrong upper bound