get the groups then delete

Minor optimization to slightly reduce marker flickering when using BFT.
Just change of code order
Merge pull request #1481 from jodav/reduceBFTFlickering

get the groups then delete