added react infinite loop