Improved the if statement in the global.php file