dont close a window when a required field is missing