fixed bugs in phonegap env