Added some logError prints to getGroups function