This looks like a paste-o. Don't you want to put the post-actions in deferred-sql or something like that?