disciplining threads
fixed threading issue