Updated pub.php controller