added function to add id to objects