added an AppState singleton class.