add max threadN
debug