Fix Editing mode  logic