try to prevent problems when rendering to string at the same time it's being modified.