bug fix dual code