added thread macro