fixed bugs for PTsampler