update function and edit toggle moved to body.on