Made Youtube ajax function more robust to network latency