Fixes bug of not recognising XMLHttpRequests