implement of renderSync