[refs #1266] Updated the delete function