Added try catch to the page evaluation function so that the script will terminate