Sprite Error on 'Prepare' method

i have my code work correctly during ‘Play Game’ mode.
which my character stay static with following code

 self.instance:prepare("idle")  
 self.instance:play()  

which will perform ‘idle’ action. But once the game is ‘Game over’ mode, then i will swtich to ‘Character Select’ mode again (i am using Director class to do that)
After character is selected, it will came back to ‘Play Game’ mode.
But this time, the program will show error below

Runtime error  
 /Users/admin/Desktop/myCorona/ionr2/Player.lua:361: attempt to call method 'prepare' (a nil value)  
stack traceback:  
 [C]: in function 'prepare'  
 /Users/admin/Desktop/myCorona/ionr2/Player.lua:361: in function 'idle'  

any idea on this? it’s actually a sprite function ‘prepare’

thanks for showing some light here [import]uid: 10373 topic_id: 9377 reply_id: 309377[/import]

Where is this instance set up?
When director changes scenes / modules, it clears the old one entirely from memory, so there might be a problem there. [import]uid: 46639 topic_id: 9377 reply_id: 34337[/import]

I was facing similar problem. After bit of digging, I found of one of my object wasn’t inserted in localGroup which led to this error somehow.
[import]uid: 48521 topic_id: 9377 reply_id: 34369[/import]