Use a toplevel window instead of message box since the latter is blocking