fix bug:add barrier for to sync