Replace extend with append