fix crash when restarting the phone