Implement try/catch in the render function