diff --git a/ckeditor.module b/ckeditor.module
index ab868ee..57865d2 100644
--- a/ckeditor.module
+++ b/ckeditor.module
@@ -108,7 +108,7 @@ function ckeditor_menu() {
     'title' => 'Clone the CKEditor profile',
     'description' => 'Configure the rich text editor.',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('ckeditor_admin_profile_clone_form', 5),
+    'page arguments' => array('ckeditor_admin_profile_clone_form', 5, 'clone'),
     'file' => 'includes/ckeditor.admin.inc',
     'access arguments' => array('administer ckeditor'),
     'type' => MENU_CALLBACK,
@@ -118,7 +118,7 @@ function ckeditor_menu() {
     'title' => 'Edit the CKEditor profile',
     'description' => 'Configure the rich text editor.',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('ckeditor_admin_profile_form', 5),
+    'page arguments' => array('ckeditor_admin_profile_form', 5, 'edit'),
     'file' => 'includes/ckeditor.admin.inc',
     'access arguments' => array('administer ckeditor'),
     'type' => MENU_CALLBACK,
@@ -682,4 +682,4 @@ function ckeditor_modules_uninstalled($modules) {
           ->execute();
     }
   }
-}
\ No newline at end of file
+}
diff --git a/includes/ckeditor.admin.inc b/includes/ckeditor.admin.inc
index b3c576f..2ee211a 100644
--- a/includes/ckeditor.admin.inc
+++ b/includes/ckeditor.admin.inc
@@ -556,7 +556,7 @@ function ckeditor_admin_global_profile_form_submit($form, &$form_state) {
 /**
  * Form builder for a profile
  */
-function ckeditor_admin_profile_form($form, $form_state, $profile = NULL) {
+function ckeditor_admin_profile_form($form, $form_state, $profile = NULL, $task = 'add') {
   global $theme;
 
   if ($profile != NULL) {
@@ -588,7 +588,7 @@ function ckeditor_admin_profile_form($form, $form_state, $profile = NULL) {
     '#collapsed' => TRUE
   );
 
-  switch (arg(4)) {
+  switch ($task) {
     case 'clone':
       //load all profiles to check their names
       $profiles = ckeditor_profile_load();
@@ -1470,8 +1470,8 @@ function ckeditor_admin_profile_form_submit($form, &$form_state) {
 /**
  * Form builder for a clone profile
  */
-function ckeditor_admin_profile_clone_form($form, $form_state, $oldprofile) {
-  return ckeditor_admin_profile_form($form, $form_state, $oldprofile);
+function ckeditor_admin_profile_clone_form($form, $form_state, $oldprofile, $task) {
+  return ckeditor_admin_profile_form($form, $form_state, $oldprofile, $task);
 }
 
 /**
