seems to have answered your problem, so I'd like to toss in a minor nit -- you might want to display a warning if
fails. Otherwise you have a silent error (after you remove the debugging
). That is, you don't signon, you don't get the file, but things clean up nicely without you knowing nothing happened.