Change to use cordova plugin