fix a bug and add sampling