added "return as string" option for render()