replace index sample