fix bug for delete operation