added threading
changed