update next pointer only when current element is target