removed debugs, removed tryCount parameter from showDialog()