changed this to init from render, render is called twice