Improved the mechanism of TolX and TolFun