rewrite the resource item