fixed a problem in the intervaction between dynamic threading and the emptiness check
new script to calculate the standard deviation