Background scrolling speed multiplies when story board restarted

I’m having a 3 screen game

  1. Start

  2. Game

  3. Restart

When game is over I navigate to restart screen. From restart screen I’ll recall game screen as below

storyboard.gotoScene("game", "fade", 400)  

and This is my function to scroll background

function scrollJungle(self, event) &nbsp;&nbsp;&nbsp;&nbsp;if self.x \< -1195 then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.x = 600 &nbsp;&nbsp;&nbsp;&nbsp;else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.x &nbsp;= self.x - self.speed &nbsp;&nbsp;&nbsp;&nbsp;end end &nbsp;

Before starting the game screen from restart I purge in enterScene function as below

function scene:enterScene( event ) &nbsp;&nbsp;&nbsp;&nbsp;local group = self.view &nbsp;&nbsp;&nbsp;&nbsp;storyboard.purgeScene("game") &nbsp;&nbsp;&nbsp;&nbsp;background:addEventListener("touch", startGame) end &nbsp;

This is how my collision and game over function looks like

function gameOver() &nbsp;&nbsp;&nbsp;&nbsp;storyboard.gotoScene("restart", "fade", 400) end local function onCollision(event) &nbsp;&nbsp;&nbsp;&nbsp;if ( event.phase == "began" ) then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(event.object1.myName~="invisibleTile" and event.object2.myName~="invisibleTile" and event.object1.myName~="ceiling" and event.object1.myName~="ceiling") then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runtime:removeEventListener("enterFrame", jungleFirstFrame) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runtime:removeEventListener("enterFrame", jungleScndFrame) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runtime:removeEventListener("enterFrame", jungleThrdFrame) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runtime:removeEventListener("enterFrame", dangerPost) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runtime:removeEventListener("enterFrame", dangerScndPost) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runtime:removeEventListener("touch", touchScreen) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Runtime:removeEventListener("collision", onCollison) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hero.bodyType="static" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hero.isVisible=false &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;heroDies.x = hero.x &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;heroDies.y = hero.y &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;heroDies.isVisible = true &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;heroDies:play() &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timer.performWithDelay(2000, gameOver, 1) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp; &nbsp; end end &nbsp;

But for some reason the background scrolling speed multiplies every time I restart the game. What am I doing wrong here. 

Thanks for your time in advance

adding a “removeListener” for background in enterScene function fixed the issue

adding a “removeListener” for background in enterScene function fixed the issue