adding auto close for print