made some windows exit when submit or cancel is pressed.