open files at the very beginning