Fix for phonegap 3.0