deep clone to make search work