fixing stacking bug