fixed opening files