sorted out the supposed barrier problem and now also only process the specified kernel function