fix index of update_at_ function

Nearest Neighbor set a row for an incorrect id when it tries to overwrite the row of existing ids.
This patch fixes the bug.