Screen not removing objects when changing tab ?

Hi

I have the code below in a TabBar/Scrolling List view

Currently im trying to remove the objects on screen when switching tab, I can do it for screen 1 and 3, but not 2. I have a feeling im going wrong from the new table onwards

My code is below:

module(…, package.seeall)

function new()

local g = display.newGroup()

tableView = require(“tableView”)
local tableData = require(“tableData”)
local t = tableData.table1
local ta = tableData.table2
local tr = tableData.table3
local last = tableData.maximum
local Reward = display.newText("", 220,700,native.systemFont,20)
local background = display.newImage(“coffeeBg.png”)
local data = {}

data[1] = {}
data[1].title = “Hot Coffee”
data[1].subtitle = “Grounds brewed in hot water”
data[1].image = “coffee1.png”

data[2] = {}
data[2].title = “Iced Coffee”
data[2].subtitle = “Chilled coffee with ice”
data[2].image = “coffee2.png”

data[3] = {}
data[3].title = “Espresso”
data[3].subtitle = “Concentrated by forcing hot water”
data[3].image = “coffee3.png”

data[4] = {}
data[4].title = “Cappuccino”
data[4].subtitle = “Espresso with frothy milk”
data[4].image = “coffee4.png”

data[5] = {}
data[5].title = “Latte”
data[5].subtitle = “More milk and less froth”
data[5].image = “coffee5.png”

data[6] = {}
data[6].title = “Americano”
data[6].subtitle = “Espresso with hot water”
data[6].image = “coffee6.png”

local redbutton = display.newImage (“redbutton.png”)
redbutton.x = 400
redbutton.y = 100
g:insert(redbutton)

redbutton:addEventListener( ‘touch’, function( e )
if e.phase == “ended” then
print “hi”
Reward.text = tostring(tr[1])
director:changeScene (“screen1”)
end
end)

local myList = tableView.newList{
data=data,
default=“listItemBg_white.png”,
backgroundColor={255,255,255},
callback = function( row )
local g = display.newGroup()

local img = display.newImage(row.image)
g:insert(img)
img.x = math.floor(img.width*0.5)
img.y = math.floor(img.height*0.5)

local title = display.newText( row.title, 0, 0, native.systemFontBold, 14 )
title:setTextColor(0,0,0)
g:insert(title)
title.x = title.width*0.5 + img.width + 6
title.y = 30

local subtitle = display.newText( row.subtitle, 0, 0, native.systemFont, 12 )
subtitle:setTextColor(80,80,80)
g:insert(subtitle)
subtitle.x = subtitle.width*0.5 + img.width + 6
subtitle.y = title.y + title.height + 6

return g
end
}

function g:cleanUp()
g:removeSelf()

end
return g
end [import]uid: 43191 topic_id: 8456 reply_id: 308456[/import]

please try to use the [lua] [/lua] tags when posting code.

thanks
j [import]uid: 6645 topic_id: 8456 reply_id: 30280[/import]

Noted, thanks, also i worked it out

silly me, missed g:insert(myList) !! [import]uid: 43191 topic_id: 8456 reply_id: 30286[/import]