Fix key not being updated in object upon editing