added phonegap support