automate stacking of multiple popups

not exactly perfect but does the trick for now