bugfix for reading files