fix missing dependency and add typeof == undefined check for $scope.validation