added phonegap specific code