Add a cleanup function to game state script.
Add script file for the main context.