the render method should swap to the local-function temporarily after calling the render method for security reasons.