complete xhr function for comment