fix NPE at app-close