Removed flag global variable to only use saveGame
Moved dialog callback functions to a single callback onClose with event information