Hotfix: obj.id should be out of var definition block