add Thread support