added kludge fix for empty tree