Bug fixed with XMLHttpRequest