Update code for use in Phonegap Build