improvements to viewfile