Fix crash when relaunching the app