useEffect with setInterval and setTimeout