fix foundation stacking bug