Related resources for useEffect executes twice