handle timeouts in xhr