check balanced tree