Updated code snippet to use groups selector