fixed re-rendering issue