modified tree adapter class