Added threading for scripts