adds id to the object

fixes #884