attempting to fix writing problem in printing