Refactored the ios Safari bug.