changed implementation of app delegate