set id to the one which is firstly missing  when adding  instance to bns