avoid crash in case of no 'window' property in app delegate