stat.php works now with the changes from last commit