fixed the error in getUpperBound()