correct a index bug for coprime sampling