code corrected to work with Phonegap 4.0
4.0.0 version update