fix ternery expression in group