fixed a bug in samplers