added thread processing