using model.isAttribute instead of id

modified the library a bit to use idAttribute instead of json.id .