rearranged the crashing dialog panel code.