make it work under phonegap