modified scan method for Cordova 3.0 plugin