just before making app-state non-global