add error control on delete node