improved improvement to popup and print