Fixed loop open file