Minor Fix to delete function