add grouping threads in a group codes