attempt to errorproof readfile