Changed the reference to a copy for the render function.