merged add individual ids code and remove dup ids code