debugging issue with printing file