fixed issues with reading file