just made some changes to checking for empty tree

just made some changes to checking for empty tree