fix edit twice loses array edits bug