first attempt to get this as phonegap 3 compatible