your already in the iterator so why not just cursor.update(X); then continue immediately after?