Added some lines for the delete function