datasample function dependency issue solved