fixed end_sampler bug