fix reading files