pass xhr to callbacks