moving the externalinterface.addcallback functions to connect