added blocking in thread struct