popup now changes position if it goes beyond bottom of screen.