make BeginWhereGroup code work the same