fixed dialog closing