replace extend with insert