finish history delete dialog code