Got rid of random opening of the file