Added check to toggle active sections when returning to edit