fixed save dialog upon trying to close program with x