fix tooltips going off the edge