diff --git a/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php b/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
index <HASH>..<HASH> 100644
--- a/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
+++ b/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
@@ -959,11 +959,11 @@ class EloquentPageRepository implements PageRepositoryInterface {
 
 		if ($permanent)
 		{
+            $this->logHistory('deleted', $page->id, ['page_name' => $page->name]);
+
 			$this->deleteSubPages($page, true);
 			$this->urls->delete('page', $page->id);
 			$page->delete();
-
-			$this->logHistory('deleted', $page->id, ['page_name' => $page->name]);
 		}
 		else
 		{
When deleting a page, need to log the fact it was deleted first, otherwise the versions have gone and the name can't be generated.