Fixed bug with edit state persistence