fix for empty thread handling