updates ajax snippet