read files in thread . Fixed bug