add directory processing with threads