delete node updates tail if the last node is deleted