debugging multi-thread behavior