fix bug that leaves nested containers when orientation matches