fixed the open files issue