getProfiles function added