Fixing invalid obj reference