correcting getGroups to return an array