fix rerendering issue