added Thread-Logic