more bugs in viewFile();