callback: add tree&compare callback funcations