improved improvement to print and popup