Fixed a re-rendering bug