checking for clean tree and empty message