middleware adds recursively delete comment function