Hide Dialog from display before disposing not after to prevent errors.