Cordova file plugin works only once after installation

Hi. I’m using cordova file plugin for my app. Here is my code and it alerts me after installing app.

$cordovaFile.getFreeDiskSpace().then(function (success) {
  alert("disk space: " + success);
}, function (error) {
  alert("error disk space :" + error);
});

But after closing the app and reopening again, app crashes and becomes just a blank page.

Any idea?