check tree balanced