Added error to the templateUrl helper function