         rating: process.env.HUBOT_GIPHY_DEFAULT_RATING
       }, state.options
       @api.search options, (err, res) =>
-        @handleResponse state, err, => @getRandomResult(res.data, @getUriFromResult)
+        @handleResponse state, err, => @getRandomResultData(res.data, @getUriFromResultData)
     else
       @getRandomUri state
 

    while @getNextOption state
      null

  getRandomResult: (data, callback) ->
    if data and callback and data.length > 0
      callback(if data.length == 1 then data[0] else data[Math.floor(Math.random() * data.length)])

  getUriFromResult: (result) ->
    if result and result.images and result.images.original
      result.images.original.url

  getSearchUri: (state) ->
    @log 'getSearchUri:', state

      rating: process.env.HUBOT_GIPHY_DEFAULT_RATING
    }, state.options
    @api.trending options, (err, res) =>
      @handleResponse state, err, => @getRandomResultData(res.data, @getUriFromResultData)

  getHelp: (state) ->
    @log 'getHelp:', state
