rewrite delete alert function