fix RangeError