rewriting of getProfiles() method