cuda bug fix after merge