Update script to handle unexpected alert error