fix sampling to have consistent seed