media_locator.php Improved the way to handle errors