fix sample larger than population problem