fixed createFileStream func