add editing mode functionality