update or insert condition when install agni