better popup positioning