Fixed some crash issues in app delegate
Merge pull request #3 from gatropino/coreData2

Fixed some crash issues in app delegate