fix bug with delete operation