fix editing mode logic
fix editing mode logic