fixed some bugs with motif tree