removing duplicated trees