work around a mobile safari bug that freezes the browser