fixed seed issue with sample()