fix crash when app is opened for first time