Script thread manageent

Here it is