fixed small bug related to reading files