reselects midpoint if divide by zero error
reselects midpoint if divide by zero error