 			origin: opts.origin,
 			options: opts.options,
 			expire: 600
-		dbstates.add data, (err, state) =>
-			@_dbAddedCallback(err, state, provider, parameters, opts, callback)
-
-	_dbAddedCallback: (err, state, provider, parameters, opts, callback) ->
+		dbstates.add newStateData, (err, state) =>
+			return callback(err) if err
+			@_getRequestToken(state, provider, parameters, opts, callback)
+
+	_getRequestToken: (state, provider, parameters, opts, callback) ->
 		request_token = provider.oauth1.request_token
 		query = {}
 		if typeof opts.options?.request_token == 'object'

				return keyset[val].join params[val].separator || ","
			return keyset[val]

	authorize: (provider, parameters, opts, callback) ->
		@_setParams(provider.parameters)
		@_setParams(provider.oauth1.parameters)
		data =
			key: opts.key,
			provider: provider.provider,
			redirect_uri: opts.redirect_uri,

		query.oauth_token = responseParser.oauth_token
		url = @_replaceParam authorize.url, @_params, {}, parameters
		url += "?" + querystring.stringify query
		return url

	access_token: (state, req, callback) ->
		if not req.params.oauth_token && not req.params.error
