support for variable thread_count added