 <p>I solved the problem by removing the line</p> <pre><code>storyboard.purgeScene("onevsone") </code></pre> <p>from the exitscene event of the scene and arranging the code like below</p> <pre><code>local function btnTap(event) local function onAlertComplete(event) if "clicked" == event.action then local i = event.index if i == 1 then storyboard.gotoScene("luduMenu") end end end native.showAlert( "End Game?", "Are you sure you want to exit this game?", { "Yes", "No" }, onAlertComplete ) return true end </code></pre>