fix a bug in min sampling method