added function to delete node