patched javascript alert freezing the UI thread