added write arg to render method