fixed printFile bug