add try catch to Alert window thread