Prevented alert message from breaking page