fix bug with double-save prevention