fixed deletion for top level nodes