fix bugs about the data processing in the tool-sampling