Adding xhr checking