duplicated query insert doing accounting