using render function