diff --git a/src/android/sqlDB.java b/src/android/sqlDB.java
index <HASH>..<HASH> 100644
--- a/src/android/sqlDB.java
+++ b/src/android/sqlDB.java
@@ -158,17 +158,26 @@ public class sqlDB extends CordovaPlugin {
 
     private void copyDbToStorage(String dbname, String dest, final CallbackContext callbackContext){
         File source = cordova.getActivity().getDatabasePath(dbname);
-        File destFolder;
+	File destFolder;
 	File destination;
+		
         if(dest.indexOf("file://") != -1){
             destination = new File(dest.replace("file://","") + dbname);
         } else {
             destination = new File(dest + dbname);
         }
+			
+	destFolder = new File(dest);
+		
         if(!destFolder.exists()){
             destFolder.mkdirs();
         }
 	
+        if(!destFolder.exists()) {
+            sendPluginResponse(404, "Invalid output DB Location", true, callbackContext);
+	    return;
+        }
+
         if(source.exists()) {
             this.newCopyDB(source,destination,callbackContext);
         } else {
Update sqlDB.java

Fixed not initialized destFolder

Added check for destFolder existence and error message if doesn't exist