Feature/issue 21 threads block

@march44 , could you please review and check if the issue is fixed?