fix popup centering script