fix error when log is not initialized in index.php