add callback to delete function