Add exception handling for tk messagebox