fix issue #243

require cordova to local variable instead of access the global cordova variable