File reading fixed