fix bug that prevent react components to be reused