modified AppDelegate.cpp