.source() does not work

Android, appium 1.7, real deviece, node.js, Mac OS

For some reason, using .source() does not work. it returns undefined. here’s my code:


const wd = require('wd');

var session = wd.remote('localhost',4723);
        platformName: 'android',
        platformVersion: '7.0',
        deviceName: 'ZY333VMBDL',
        app: '/Users/xxx/tmp/cmsmobile.apk'
}, () =>{
    session.sleep(10000,() => {

figured it out. I had to use the callback function. On top of that, it has a delay before it responds, for some reason.