fixed rerendering bugs