rewritted the render method