first render code