Add this to helper.php
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
under this
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.');