Added an xhr function