           @stationMaster = json
           @setAutoComplete($('.autoCompleteStation'))
       setAutoComplete: (elem) ->
+        elem.typeahead('destroy')
         design = {hint: true, highlight: true}
-        config = {name: 'stations', display: 'name', source: stationMatcher(@stationMaster)}
+        config = {name: 'stations', display: 'name', source: stationMatcher(@stationMaster), limit: 100}
         elem.typeahead(design, config)
       submit: ->
         stations = _.flatMap @stations, (s) =>

      @getStations()
    watch:
      stations: ->
        @setAutoComplete($('.autoCompleteStation:last'))

stationMatcher = (xs) ->
  (q, cb) ->

            location.reload(false)
      addStation: ->
        @stations.push({name: ""})
        @setAutoComplete($('.autoCompleteStation'))
      findStationId: (name) ->
        st = _.find @stationMaster, (s) -> s.name == name
        st?.id
