improved improvment to print and popup