Changed dirtyread to work with  threads