changed mtrender to render, added io object as first argument of render.