fix section deletion code