diff --git a/sites/all/modules/profile2_regpath/profile2_regpath.module b/sites/all/modules/profile2_regpath/profile2_regpath.module
index e26d7df..4736a7d 100755
--- a/sites/all/modules/profile2_regpath/profile2_regpath.module
+++ b/sites/all/modules/profile2_regpath/profile2_regpath.module
@@ -178,7 +178,8 @@ function profile2_regpath_form_alter(&$form, &$form_state, $form_id) {
 
       // Grab first part of URL.
       $path_parts = explode('/', $path);
-      $path_key = reset($path_parts);
+      end($path_parts);
+      $path_key = prev($path_parts);
 
       // Load profiles for this path key.
       $profile_types = profile2_regpath_regpath_load_multiple(array('path' => $path_key, 'status' => 1));
