fixed some problems with the children threads