found and fixed bug in getAllthreads with nested branching (2+ levels)