added `save on close` option