diff --git a/build.bat b/build.bat
index ae13ab5..2c11172 100644
--- a/build.bat
+++ b/build.bat
@@ -1,2 +1,3 @@
 del index.php
+php rebuild_module_index.php
 php build.php 
diff --git a/core.php b/core.php
index 95df86e..e9868a5 100644
--- a/core.php
+++ b/core.php
@@ -391,6 +391,9 @@ $modules = []; // list that contains all the loaded modules
 // function to register a module
 function register_module($moduledata)
 {
+	global $modules;
+	//echo("registering module\n");
+	//var_dump($moduledata);
 	$modules[] = $moduledata;
 }
 
@@ -398,6 +401,8 @@ function register_module($moduledata)
 $actions = new stdClass();
 function add_action($action_name, $func)
 {
+	global $actions;
+	//echo("adding $action_name\n");
 	$actions->$action_name = $func;
 }
 
@@ -413,17 +418,17 @@ foreach($modules as $moduledata)
 	$moduledata["code"]();
 }
 // make sure that the credits page exists
-if(!isset($actions["credits"]))
+if(!isset($actions->credits))
 {
-	exit(renderpage("Error - $settings->$sitename", "<p>No credits page detected. The credits page is a required module!</p>"))
+	exit(renderpage("Error - $settings->$sitename", "<p>No credits page detected. The credits page is a required module!</p>"));
 }
 
 // Perform the appropriate action
-if(isset($actions[strtolower($_GET["action"])]))
+$action_name = strtolower($_GET["action"]);
+if(isset($actions->$action_name))
 {
-	$req_action = strtolower($_GET["action"]);
-	$req_action_data = $action_name->$req_action;
-	$req_action_data["code"]();
+	$req_action_data = $actions->$action_name;
+	$req_action_data();
 }
 else
 {
diff --git a/index.php b/index.php
index ab75997..9782c16 100644
--- a/index.php
+++ b/index.php
@@ -519,6 +519,9 @@ $modules = []; // list that contains all the loaded modules
 // function to register a module
 function register_module($moduledata)
 {
+	global $modules;
+	//echo("registering module\n");
+	//var_dump($moduledata);
 	$modules[] = $moduledata;
 }
 
@@ -526,6 +529,8 @@ function register_module($moduledata)
 $actions = new stdClass();
 function add_action($action_name, $func)
 {
+	global $actions;
+	//echo("adding $action_name\n");
 	$actions->$action_name = $func;
 }
 
@@ -624,7 +629,7 @@ register_module([
 
 register_module([
 	"name" => "Page editor",
-	"version" => "0.4",
+	"version" => "0.5",
 	"author" => "Starbeamrainbowlabs",
 	"description" => "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
 	"id" => "page-edit",
@@ -664,7 +669,7 @@ register_module([
 				if(!$creatingpage)
 				{
 					//the page already exists - let the user view the page source
-					exit(renderpage("Viewing source for $page", "<textarea readonly>$pagetext</textarea>"));
+					exit(renderpage("Viewing source for $page", "<p>$settings->sitename does not allow anonymous users to make edits. You can view the source of $page below, but you can't edit it.</p><textarea name='content' readonly>$pagetext</textarea>"));
 				}
 				else
 				{
@@ -1132,17 +1137,17 @@ foreach($modules as $moduledata)
 	$moduledata["code"]();
 }
 // make sure that the credits page exists
-if(!isset($actions["credits"]))
+if(!isset($actions->credits))
 {
-	exit(renderpage("Error - $settings->$sitename", "<p>No credits page detected. The credits page is a required module!</p>"))
+	exit(renderpage("Error - $settings->$sitename", "<p>No credits page detected. The credits page is a required module!</p>"));
 }
 
 // Perform the appropriate action
-if(isset($actions[strtolower($_GET["action"])]))
+$action_name = strtolower($_GET["action"]);
+if(isset($actions->$action_name))
 {
-	$req_action = strtolower($_GET["action"]);
-	$req_action_data = $action_name->$req_action;
-	$req_action_data["code"]();
+	$req_action_data = $actions->$action_name;
+	$req_action_data();
 }
 else
 {
diff --git a/module_index.json b/module_index.json
index d8f313f..3dcc39e 100644
--- a/module_index.json
+++ b/module_index.json
@@ -25,11 +25,11 @@
     },
     {
         "name": "Page editor",
-        "version": "0.4",
+        "version": "0.5",
         "author": "Starbeamrainbowlabs",
         "description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
         "id": "page-edit",
-        "lastupdate": 1428758936
+        "lastupdate": 1431113232
     },
     {
         "name": "Help page",
diff --git a/modules/page-edit.php b/modules/page-edit.php
index 2957bfe..faba278 100644
--- a/modules/page-edit.php
+++ b/modules/page-edit.php
@@ -1,7 +1,7 @@
 <?php
 register_module([
 	"name" => "Page editor",
-	"version" => "0.4",
+	"version" => "0.5",
 	"author" => "Starbeamrainbowlabs",
 	"description" => "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
 	"id" => "page-edit",
@@ -41,7 +41,7 @@ register_module([
 				if(!$creatingpage)
 				{
 					//the page already exists - let the user view the page source
-					exit(renderpage("Viewing source for $page", "<textarea readonly>$pagetext</textarea>"));
+					exit(renderpage("Viewing source for $page", "<p>$settings->sitename does not allow anonymous users to make edits. You can view the source of $page below, but you can't edit it.</p><textarea name='content' readonly>$pagetext</textarea>"));
 				}
 				else
 				{
