re-implemented the open files functionality