if $scope.coords is not defined, if statement will crash.