improve profile popup handling