fix bug with popup centering