add print dialog and autoclose