Fix crash coming back from safari