fixed download token issues with flash
moved WDPDialogClose to after button declaration