fix open files behaviour