Fix safari crash