Bug fixing and added getGroups() method