didExitScene event gets called before scene transition finishes

It is my understanding that didExitScene gets executed right after a scene transition ends but in my case it gets called right after my scene transitions slideLeft and slideRight take place, just like exitScene. Any help?
 

local img\_square = "gfx/square.png" local storyboard = require "storyboard" storyboard.isDebug = true -- main menu scene local mainMenu = storyboard.newScene("mainMenu") function mainMenu:createScene(event) local group = self.view local mainMenuImage = display.newImage(img\_square) mainMenuImage.x, mainMenuImage.y = display.contentWidth, display.contentHeight\*0.5 mainMenuImage.anchorX = 1 mainMenuImage:scale(4,4) function mainMenuImage:touch(event) storyboard.gotoScene("main", {effect = "slideLeft", time = 500}) end mainMenuImage:addEventListener("touch") group:insert(mainMenuImage) end function mainMenu:didExitScene(event) print("did exit main menu scene.") -- gets printed right after scene transition begins end mainMenu:addEventListener("createScene") mainMenu:addEventListener("didExitScene") -- main scene local main = storyboard.newScene("main") function main:createScene(event) local group = self.view local mainImage = display.newImage(img\_square) mainImage.x, mainImage.y = 0, display.contentHeight\*0.5 mainImage.anchorX = 0 mainImage:scale(4,4) function mainImage:touch(event) storyboard.gotoScene("mainMenu", {effect = "slideRight", time = 500}) end mainImage:addEventListener("touch", mainImage) group:insert(mainImage) end function main:didExitScene(event) print("did exit main scene.") -- gets printed right after scene transition begins end main:addEventListener("createScene") main:addEventListener("didExitScene") storyboard.gotoScene("mainMenu")