object not being removed from a group after a collision and a scene change

Hi guys, I need to remove few objects from a group inside a runtime collision function and after I change the scene.

The code I’m using is:

function onCollision( event ) if ( event.phase == "began" ) then if event.object1.myName == "ground" and event.object2.myName == "spaceShip" then timer.cancel(tmrScore) gameOver.alpha = 1 tapToReplay.alpha = 1 replay.alpha = 0.01 fade.alpha = 0 timer.cancel(tmrIS) spaceShip.alpha = 1 if(playEffects) then media.playEventSound( "sounds/gameover.mp3" ) playEffects = false end speed = 0 local matchScore = score.get() local bestScore = score.load() if (matchScore \< bestScore) then local best = display.newText("Best:", \_W/2, 215, "PUSAB", 16) best.alpha = 1 best:setFillColor(1, 0.5, 0) localGroup:insert(best) local scoreToBeat = display.newText(score.load(), \_W/2, 250, "PUSAB", 16) scoreToBeat.alpha = 1 scoreToBeat:setFillColor(127, 255, 0) localGroup:insert(scoreToBeat) else print ("New Record!!") score.save() print (score.load()) best.alpha = 0 local bestScore = display.newText("New record!", \_W/2, 215, "PUSAB", 16) bestScore.alpha = 1 bestScore:setFillColor(255, 0, 0) localGroup:insert(bestScore) end end end end Runtime:addEventListener( "collision", onCollision )&nbsp;

and I change the scene using

local replay = display.newImageRect("images/replay.png", 568, 320) replay.x = \_W/2 replay.y = \_H/2 replay.alpha = 0 localGroup:insert(replay) local function replay\_game(event) if event.phase == "ended" then director:changeScene("get\_ready") end end replay:addEventListener("touch", replay\_game)

Now the problem is that when I reload the scene (through “get_ready”, which bring the user back to the “game” scene) ‘best’, ‘scoreToBeat’ and  ‘bestScore’ still inside localGroup and they are not removed and so the next time a collision is performed, the Terminal returns “Attempt to call method ‘insert’ (a nil value)”.

What can I do? Thanks in advantage!