fix mobile safari alert issues (fix #850)