       expect(sessionId).not.toBeNull()
       expect(sessionId.length).toBeGreaterThan(5)
 
-    opentok.createSession 'localhost', {'p2p.preference':'enabled'}, (result) ->
+    opentok.createSession 'localhost', {'p2p.preference':'enabled'}, (err, result) ->
       sessionId = result
       queryFinished = true
 

      expect(sessionId).not.toBeNull()
      expect(sessionId.length).toBeGreaterThan(5)

    opentok.createSession 'localhost', (result) ->
      sessionId = result
      queryFinished = true


      expect(sessionId).not.toBeNull()
      expect(sessionId.length).toBeGreaterThan(5)

    opentok.createSession (err, result) ->
      sessionId = result
      queryFinished = true

