fixed the Windows specific file opening code