Adapted directory.php to work with the latest version of BeeHub