fix a number of issues that appears with cordova